<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CategoryAddEdit.ascx.cs" Inherits="IGlobalist.Cms.Admin.Control.CategoryAddEdit" %>
<%@ Register Src="CmsExtPropertiesForm.ascx" TagName="CmsExtPropertiesForm" TagPrefix="uc1" %>

<asp:HiddenField runat="server" ID="hdfCategoryID" Value="0" />
<asp:HiddenField runat="server" ID="hdfCategoryIDXML" Value="0" />
<table  id="tblNewCategory" runat="server">
     <tr>
        <th colspan="2" align="center">
            <asp:Label runat="server" ID="lblStatus" ForeColor="#1A5688" Font-Bold="True" Font-Size="Medium"/>
        </th>        
      </tr>
    <tr>
        <td>
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True" />
        <fieldset id="fsMain" runat="server">
            <legend><asp:Label ID="lbMain"  runat="server"  Text="Main Properties"></asp:Label> </legend>
                <table cellpadding="2" cellspacing="2">                   
                    <tr>
                        <td >
                            <asp:Label ID="lbClassName" runat="server" Text="Category Class"></asp:Label>
                        </td>
                        <td >
                            <asp:DropDownList ID="ddlClassName" runat="server" DataTextField="Name" DataValueField="ID" OnSelectedIndexChanged="ddlClassName_SelectedIndexChanged" AutoPostBack="True" ></asp:DropDownList>
                            <asp:Label ID="lbError" runat="server" Font-Size="8pt" ForeColor="Red"></asp:Label> 
                        </td>
                    </tr>
                    <tr>
                        <td >
                            <asp:Label ID="lbName" runat="server" Text="Name"></asp:Label>
                        </td>
                        <td >
                            <asp:TextBox ID="tbName" runat="server"></asp:TextBox>                            
                            <asp:RequiredFieldValidator ID="rfvName" runat="server" ErrorMessage="Must enter name" ControlToValidate="tbName" >*</asp:RequiredFieldValidator>                             
                        </td>
                    </tr>
                    <tr>
                        <td valign="top"  >
                            <asp:Label ID="lbDescription" runat="server" Text="Description"></asp:Label>
                        </td>
                        <td >
                            <asp:TextBox ID="tbDescription" runat="server" Rows="4" Height="100px" TextMode="MultiLine"></asp:TextBox>
                        </td>
                    </tr>                   
                    <tr>
                        <td >
                            <asp:Label ID="lbParent" runat="server" Text="Parent"></asp:Label>  
                        </td>
                        <td >
                            <asp:DropDownList ID="ddlParentXml" runat="server" Visible="False" DataTextField="Name" DataValueField="Id" DataSourceID="ODSParentXML">
                            </asp:DropDownList><asp:ObjectDataSource ID="ODSParentXML" runat="server" SelectMethod="GetCategoryXMLForBindTree"
                                TypeName="IGlobalist.Cms.Bll.CategoryController">
                                <SelectParameters>
                                     <asp:ControlParameter ControlID="hdfCategoryIDXML" DefaultValue="0" Name="currentID"
                                        PropertyName="Value" Type="Int64" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                        
                            <asp:DropDownList ID="ddlParent" runat="server" DataTextField="Name" DataValueField="ID" DataSourceID="ODSCategories"  >
                            </asp:DropDownList><asp:ObjectDataSource ID="ODSCategories" runat="server" SelectMethod="GetCategoryTreeForBind"
                                TypeName="IGlobalist.Cms.Bll.CategoryController">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="ddlClassName" DefaultValue="0" Name="currentCategoryID"
                                        PropertyName="SelectedValue" Type="Int64" />
                                    <asp:ControlParameter ControlID="hdfCategoryID" DefaultValue="0" Name="categoryID"
                                        PropertyName="Value" Type="Int64" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                        </td>
                    </tr>   
                    <tr>
                        <td valign="Top" >
                            <asp:Label ID="lbOrder" runat="server"  Text="Order" ></asp:Label> 
                        </td>
                        <td valign="top" >
                            <asp:TextBox ID="tbOrder" runat="server" Text="0" MaxLength="3"></asp:TextBox>  
                            <asp:RangeValidator ID="rvOrder" runat="server" MaximumValue="999" MinimumValue="0" ErrorMessage="Order must be number" ControlToValidate="tbOrder" Type="Integer">*</asp:RangeValidator>     
                        </td>
                    </tr>
                    <tr>
                        <td><asp:Label ID="Label4" runat="server" Text="Page link"></asp:Label></td>
                        <td>
                              <asp:DropDownList ID="ddlPage" runat="server" DataTextField="Name" DataValueField="ID" DataSourceID="ODSPage"  >
                            
                              </asp:DropDownList><asp:ObjectDataSource ID="ODSPage" runat="server" SelectMethod="GetPageListForBindTree"
                             TypeName="IGlobalist.Cms.Bll.PageController">
                             <SelectParameters>
                                 <asp:Parameter DefaultValue="0" Name="classID" Type="Int64" />
                                 <asp:Parameter DefaultValue="0" Name="currentID" Type="Int64" />
                             </SelectParameters>
                         </asp:ObjectDataSource>
            
                        </td>
                    </tr>   
                    
               </table>   
        </fieldset> 
        </td>
    </tr>
    <tr>
        <td>
            <fieldset id="fsExt" runat="server" visible="false">
                <legend><asp:Label ID="lbExt"  runat="server"  Text="Ext Properties"></asp:Label> </legend>               
                <uc1:CmsExtPropertiesForm ID="ucCmsExtPropertiesForm" runat="server" />
            </fieldset> 
        </td>
    </tr>   
    <tr>
        <td>
            <fieldset id="fsContentList" runat="server">
                <legend><asp:Label ID="lb"  runat="server"  Text="ContentList"></asp:Label> </legend>
                <asp:LinkButton ID="lbtnContent" runat="server" OnClick="lbtnContent_Click">LinkButton</asp:LinkButton></fieldset> 
        </td>
    </tr>
</table> 
